import axios from '../utils'

const api = {
  filterList: '/filter-list',
  getAllDataByPage: '/filter-list/getAllDataByPage',
  getByTokenFilterList: '/filter-list/getAllDataByUser'
}

export default api

export function getAllDataByPage(parameter) {//获取全部的过滤器列表
  return axios({
    url: api.getAllDataByPage,
    method: 'get',
    params: parameter
  })
}

export function getDataByPageID(parameter) {//通过id获取的过滤器单条
  return axios({
    url: api.filterList + "/" + parameter,
    method: 'get'
  })
}

export function getFilterList() {
  return axios({
    url: api.filterList,
    method: 'get'
  })
}

export function addFilterList(parameter) {
  return axios({
    url: api.filterList,
    method: 'post',
    data: parameter
  })
}

export function delFilterList(parameter) {
  return axios({
    url: api.filterList + "/" + parameter,
    method: 'delete'
  })
}

export function getByTokenFilterList() {
  return axios.get(api.getByTokenFilterList)
}



